package com.oahcfly.chgame.egret.ui;

import java.util.HashMap;

import com.badlogic.gdx.graphics.Texture;
import com.oahcfly.chgame.core.Chao;

/**
 * 
 * 资源管理
 * @author haocao
 *
 */
public class ERes {

	private static HashMap<String, String> resourceMap = new HashMap<String, String>();

	/**
	 * 获取纹理
	 * 
	 * @param name
	 * @return
	 */
	public static Texture getResTexture(String name) {
		String url = resourceMap.get(name);
		return Chao.game.getTexture(url);
	}

	/**
	 * 加载资源
	 * 
	 * @param name
	 *            "gold_png"
	 * @param url
	 *            "game/gold.png"
	 */
	public static void loadRes(String name, String url) {
		resourceMap.put(name, url);
	}
	
	public static String getResUrl(String name){
		return resourceMap.get(name);
	}
}
